package tests.jdl.databaseObjects.datatypes.common;

import org.junit.Test;

import jdl.databaseObjects.DbType;
import jdl.databaseObjects.DbTypeUnknownException;
import jdl.databaseObjects.datatypes.common.CommonDbTypeFactory;
import jdl.databaseObjects.datatypes.common.TimestampDbType;
import junit.framework.Assert;

public class CommonDbTypeFactory_Test {
	@Test
	public void fromString_typeIsTimestamp() throws DbTypeUnknownException {
		DbType type = CommonDbTypeFactory.fromString("TiMeStAmP");
		Assert.assertEquals(new TimestampDbType(), type);
	}

	@Test(expected = DbTypeUnknownException.class)
	public void fromString_typeIsUnknown() throws DbTypeUnknownException {
		CommonDbTypeFactory.fromString("qwerty");
	}
}
